﻿using System;
using System.Collections;
using System.Web;

namespace Torch.WL.Web
{
    public class BasePage : System.Web.UI.Page
    {
        public BasePage()
        {

        }


        protected override void OnInit(EventArgs e)
        {
            if (HttpContext.Current != null)
            {
                if (!SessionHelper.CheckUserSession())
                {
                    //try
                    //{
                    Response.Redirect("~/Admin/Login.aspx");
                    //}
                    //catch (System.Threading.ThreadAbortException ex)
                    //{

                    //}
                }
            }

        }

        protected void GotoErrPage(string errorMsg)
        {
            SessionHelper.SetErrorMsg(errorMsg);
            Response.Redirect("~/Common/ErrorPage.aspx?ReturnUrl=" + System.Web.HttpUtility.UrlEncode(Request.Url.PathAndQuery), false);
         }


    }
}
